package com.he.DesignPatterns.adapter.ObjectAdapter;

import com.he.DesignPatterns.adapter.ClassAdapter.TFCard;

/**
 * @description: 适配器类
 * @Author: HCL
 * @Date: 2024/8/26 16:40
 */
public class SDAdapterTF implements SDCard {

    private TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("适配器读取TFCard");
        return tfCard.readTF();
    }

    @Override
    public void writeSD(String data) {
        System.out.println("适配器写入TFCard");
        tfCard.writeTF(data);
    }
}
